<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="com.dss.service.ExpertService"%>
<%@page import="com.dss.po.ExpertClass"%>
<%  response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");%>
<%
    request.setCharacterEncoding("UTF-8");
	List<ExpertClass> list = ExpertService.loadExpertClasses(request, response, out);
	String defaultExpertClassId = "";
	String defaultExpertClassTitle = "";
	if(list != null && list.size() > 0){
		defaultExpertClassId = String.valueOf(list.get(0).getExpertClassId());
		defaultExpertClassTitle = list.get(0).getTitle();
	}
%>
<html>
<head>
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
	<script type="text/javascript">
	</script>
	<style type="text/css">
		body,button,input,select,textarea {font:12px/1.125 "宋体",Arial;}
		ul,ol,li{list-style:none;}
		.er_tit1{background:url(top.png) no-repeat; width:250px; line-height:31px; height:31px; padding-left:20px; font-size:14px; font-weight:bold; color:#fff;}
		.left_ercon1{width:250px; height:355px; border:1px solid #d7e8ff; overflow:hidden; padding:11px 0 50px 25px;}
		.left_ercon1_1{width:200px; margin:0 auto; padding-bottom:11px;}
		.er_tit2{height:30px; overflow:hidden;}
		.er_tit2 a{background:url(class.png) no-repeat; display:block; height:30px; line-height:30px; width:200px; padding-left:19px; color:#0d348b; font-size:14px; font-weight:bold;}
		.left_ercon1_1 ul{margin:9px auto 0; width:192px; overflow:hidden;}
		.left_ercon1_1 li{float:left; width:86px;height:21px;text-align:left;padding:0px 0px 2px 10px;}
		.left_ercon1_1 li a{display:block; color:#333;height:21px; line-height:21px;padding-left:10px; }
		.left_ercon1_1 li a:hover{background:#688fc9; color:#fff; text-decoration:none;}
		.left_ercon1_1 li a.left_sel{background:#688fc9; color:#fff; text-decoration:none;}
	</style>
	<script type="text/javascript">
		var curExpertClassId;
		var curExpertClassTitle;
		
		function init(){
			var classItems = document.getElementsByName("classItem");
			var firstALabel;
			if(classItems != null && classItems.length > 0){
				firstALabel = classItems[0];
			}
			loadExperts('<%=defaultExpertClassId%>','<%=defaultExpertClassTitle%>', firstALabel);
			
		}
		
		function getSelectedClass(){
			var ret = new Array();
			ret[0] = curExpertClassId;
			ret[1] = curExpertClassTitle;
			return ret;
		}
		//.er_tit2 a:active{background:url(class_blue.png) no-repeat; color:#fff; text-decoration:none;}
		function loadExperts(id, title, aLabel){
			curExpertClassId = id;
			curExpertClassTitle = title;
			var classItems = document.getElementsByName("classItem");
			for(var i = 0; i < classItems.length; i++){
				var classItem = classItems[i];
				classItem.style.backgroundImage = 'url(class.png)';
				classItem.style.color = "#0d348b";
			}
			if(aLabel != null){
				aLabel.style.backgroundImage = 'url(class_blue.png)';
				aLabel.style.color = "#fff";
			}
			parent.frm_right.location.href = "expert.jsp?expertClassId="+id;
		}
	</script>
</head>
<body rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" onload="init();">
	 	<div class='left_ercontain1'>
			<div class='er_tit1'>
				专家分类
			</div>
			<div class='left_ercon1'>
			<%
				if(list != null){
					for(ExpertClass expertClass : list){
			%>
				<div class='left_ercon1_1'>
					<div class='er_tit2'>
						<A name="classItem" href='#' onclick="javascript:loadExperts('<%=expertClass.getExpertClassId() %>','<%=expertClass.getTitle() %>', this);"><%=expertClass.getTitle() %></A>
					</div>
				</div>
			<%
					}
				}
			%>
			</div>
		</div>
</body>
</html>
